package com.itheima.controller;

import com.itheima.pojo.CmsPrefrenceArea;
import com.itheima.service.CmsPrefrenceAreaService;
import com.itheima.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/prefrenceArea")
public class CmsPrefrenceAreaController {

    @Autowired
    private CmsPrefrenceAreaService cmsPrefrenceAreaService;

    /**
     * 获取所有商品优选
     */
    @GetMapping("/listAll")
    private ResponseEntity listAll(){
        List<CmsPrefrenceArea> cmsPrefrenceAreaList = cmsPrefrenceAreaService.listAll();
        return ResponseEntity.ok(Result.success(cmsPrefrenceAreaList));
    }
}
